home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / RCLS8J (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  1.5 KB  |  42 lines

  1. package com.sun.java.swing.plaf.metal;
  2.  
  3. import com.sun.java.swing.Icon;
  4. import com.sun.java.swing.plaf.UIResource;
  5. import java.awt.Component;
  6. import java.awt.Graphics;
  7. import java.io.Serializable;
  8.  
  9. class MetalIconFactory$TreeComputerIcon implements Icon, UIResource, Serializable {
  10.    public void paintIcon(Component c, Graphics g, int x, int y) {
  11.       g.translate(x, y);
  12.       g.setColor(MetalLookAndFeel.getPrimaryControl());
  13.       g.fillRect(5, 4, 6, 4);
  14.       g.setColor(MetalLookAndFeel.getPrimaryControlInfo());
  15.       g.drawLine(2, 2, 2, 8);
  16.       g.drawLine(13, 2, 13, 8);
  17.       g.drawLine(3, 1, 12, 1);
  18.       g.drawLine(12, 9, 12, 9);
  19.       g.drawLine(3, 9, 3, 9);
  20.       g.drawLine(4, 4, 4, 7);
  21.       g.drawLine(5, 3, 10, 3);
  22.       g.drawLine(11, 4, 11, 7);
  23.       g.drawLine(5, 8, 10, 8);
  24.       g.drawLine(1, 10, 14, 10);
  25.       g.drawLine(14, 10, 14, 14);
  26.       g.drawLine(1, 14, 14, 14);
  27.       g.drawLine(1, 10, 1, 14);
  28.       g.setColor(MetalLookAndFeel.getControlDarkShadow());
  29.       g.drawLine(6, 12, 8, 12);
  30.       g.drawLine(10, 12, 12, 12);
  31.       g.translate(-x, -y);
  32.    }
  33.  
  34.    public int getIconWidth() {
  35.       return 16;
  36.    }
  37.  
  38.    public int getIconHeight() {
  39.       return 16;
  40.    }
  41. }
  42.